#include <fhepython/PyValVar.h>
#include <fhepython/PyEnv.h>

namespace fhe
{
  namespace python
  {
    PyValVar::PyValVar( const std::string& name, boost::python::object val )
      : name_( name )
      , val_( PyEnv::instance().convertVal( val ) )
    {
    }
    
    std::string PyValVar::name() const
    {
      return name_;
    }
    
    Val PyValVar::get() const
    {
      return val_;
    }
    
    void PyValVar::set( Val val )
    {
      val_ = val;
    }
    
    bool PyValVar::trySet( Val val )
    {
      val_ = val;
      return true;
    }
  }
}
